package com.verlet.springbootdemo.common;

/**
 * @author verlet
 * @date 2021-02-27 00:58
 */
public enum ResponseCode {

    /**
     * 成功
     */
    SUCCESS(200, "SUCCESS"),
    /**
     * 非法参数
     */
    ILLEGAL_ARGUMENT(210, "ILLEGAL_ARGUMENT"),
    /**
     * 没有登录
     */
    NEED_LOGIN(401, "NEED_LOGIN"),
    /**
     * 没有权限
     */
    NO_PERMISSION(403, "NO_PERMISSION"),
    /**
     * 系统异常
     */
    ERROR(500, "ERROR"),
    ;

    private final int code;
    private final String desc;

    ResponseCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
